/*
 * Copyright (c) 2022 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
 */

/**
 * @brief phy init config parameters. These are passed to phy at init.
 */

#ifndef _PHY_RF_PARAMS_H_
#define _PHY_RF_PARAMS_H_

#define RF_PARAMS_SIZE 200

#if defined(C0_CHIP)
#ifdef ASICBUILD
#define DEF_RF_PARAMS                                                                              \
	"0000000000002C00000000000000003020302020203030300000000050EC000000000000000000000000214365003F0324240010000028003235000000F6080A7D8105010071630300EED501001F6F00003B350100F52E0000E35E0000B7B6000066EFFEFFB5F60000896200007A840200E28FFCFF08080808040A120100000000A1A101780000002C01500035020726181818181A120A140E0600"
#else
#define DEF_RF_PARAMS                                                                              \
	"0000000000002C00000000000000003020302020203030300000000050EC000000000000000000000000214365003F0324240010000028003235000000F6080A7D8105010071630300EED501001F6F00003B350100F52E0000E35E0000B7B6000066EFFEFFB5F60000896200007A840200E28FFCFF08080808040A120100000000A1A101780000002C015000350207262D2D28281A120A140E0600"
#endif
#elif defined(B0_CHIP)
#define DEF_RF_PARAMS                                                                              \
	"0000000000002C00000000000000003020302020203030300000000050EC000000000000000000000000214365003F0324240010000028003235000000F6080A7D8105010071630300EED501001F6F00003B350100F52E0000E35E0000B7B6000066EFFEFFB5F60000896200007A840200E28FFCFF08080808040A120100000000A1A101E00000002C01500035020726282828281A120A140E0600"
#else /* Simulator and Emulator */
#define DEF_RF_PARAMS                                                                              \
	"0000000000002C00000000000000003020302020203030300000000050EC000000000000000000000000214365003F032424001000002800323500000000080A7D8105010071630300EED501001F6F00003B350100F52E0000E35E0000B7B6000066EFFEFFB5F60000896200007A840200E28FFCFF08080808040A120100000000A1A101A000000028005000350207260F0F0F0F1A120A140E0600"
#endif

#define IMG_WLAN_PHY_CALIB_FLAG_RXDC 1
#define IMG_WLAN_PHY_CALIB_FLAG_TXDC 2
#define IMG_WLAN_PHY_CALIB_FLAG_TXPOW 4
#define IMG_WLAN_PHY_CALIB_FLAG_TXIQ 8
#define IMG_WLAN_PHY_CALIB_FLAG_RXIQ 16
#define IMG_WLAN_PHY_CALIB_FLAG_DPD 0

#define IMG_WLAN_PHY_SCAN_CALIB_FLAG_RXDC (1 << 16)
#define IMG_WLAN_PHY_SCAN_CALIB_FLAG_TXDC (2 << 16)
#define IMG_WLAN_PHY_SCAN_CALIB_FLAG_TXPOW (0 << 16)
#define IMG_WLAN_PHY_SCAN_CALIB_FLAG_TXIQ (0 << 16)
#define IMG_WLAN_PHY_SCAN_CALIB_FLAG_RXIQ (0 << 16)
#define IMG_WLAN_PHY_SCAN_CALIB_FLAG_DPD (0 << 16)

#define DEF_PHY_CALIB                                                                              \
	(IMG_WLAN_PHY_CALIB_FLAG_RXDC | IMG_WLAN_PHY_CALIB_FLAG_TXDC |                             \
	 IMG_WLAN_PHY_CALIB_FLAG_RXIQ | IMG_WLAN_PHY_CALIB_FLAG_TXIQ |                             \
	 IMG_WLAN_PHY_CALIB_FLAG_TXPOW | IMG_WLAN_PHY_CALIB_FLAG_DPD |                             \
	 IMG_WLAN_PHY_SCAN_CALIB_FLAG_RXDC | IMG_WLAN_PHY_SCAN_CALIB_FLAG_TXDC |                   \
	 IMG_WLAN_PHY_SCAN_CALIB_FLAG_RXIQ | IMG_WLAN_PHY_SCAN_CALIB_FLAG_TXIQ |                   \
	 IMG_WLAN_PHY_SCAN_CALIB_FLAG_TXPOW | IMG_WLAN_PHY_SCAN_CALIB_FLAG_DPD)
#define DEF_PHY_TEMP_CALIB                                                                         \
	(IMG_WLAN_PHY_CALIB_FLAG_RXDC | IMG_WLAN_PHY_CALIB_FLAG_TXDC |                             \
	 IMG_WLAN_PHY_CALIB_FLAG_RXIQ | IMG_WLAN_PHY_CALIB_FLAG_TXIQ |                             \
	 IMG_WLAN_PHY_CALIB_FLAG_TXPOW | IMG_WLAN_PHY_CALIB_FLAG_DPD)

#define DEF_PHY_VBAT_CALIB (IMG_WLAN_PHY_CALIB_FLAG_DPD)

#define TEMP_CALIB_PERIOD (1024 * 1024)
#define TEMP_CALIB_THRESHOLD (40)
#define TEMP_CALIB_ENABLE 0
#define VBAT_VERYLOW (3) /*Correspond to (2.5+3*0.07)=2.71V*/
#define VBAT_LOW (6) /*Correspond to (2.5+6*0.07)=2.92V*/
#define VBAT_HIGH (12) /*Correspond to (2.5+12*0.07)=3.34V*/

#endif
